package com.by.controller;

import com.by.common.core.bean.ResultBean;
import com.by.common.core.response.R;
import com.by.entity.OrderAddr;
import com.by.service.OrderAddrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/addr")
public class OrderAddrController {
    @Autowired
    OrderAddrService orderAddrService;

    @PostMapping("/saveOrderAddr")
    public ResultBean save(@RequestBody OrderAddr orderAddr) {
        boolean rs = orderAddrService.saveOrderAddr(orderAddr);
        return rs ? R.success("保存成功") : R.fail("保存失败");
    }
}
